//app.js
App({
  data: {
    userid:"",
  },
  onLaunch(){
    wx.cloud.init() 
  },
  login(srcpage){
    wx.getUserInfo({
      success:res=>{
        
        getApp().data.userid = res.userInfo.nickName
      },
      fail:res =>{
        wx.redirectTo({
          url: '../wxauthorized/wxauthorized?from='+ srcpage,
        })
      }
    })
  }
})